import request from '@/utils/request.js'
function tansParams(params){
  let arr = [];
  for(let key in params){
    arr.push(key + '=' + params[key])
  }
  return arr.join('&')
}
//污染源树
///pollution/dataSourcePolluteTree
export function dataSourcePolluteTree(params) {
  return request({
    url: '/pollution/dataSourcePolluteTree',
    method: 'get',
    params,
  })
}
// 污染源企业下拉-行政区划
///pollution/polluteTree
export function polluteTree(params ={}) {
  return request({
    url: '/pollution/polluteTree',
    method: 'get',
    params,
  })
}

//污染因子
///buspollutant/list
export function buspollutantList(params ={}) {
  return request({
    url: '/buspollutant/list',
    method: 'get',
    params,
  })
}
//对比分析列表
///pollution/dataAnalysis
export function dataAnalysis(params) {
  return request({
    url: '/pollution/dataAnalysis',
    method: 'get',
    params,
  })
}

//对比分析图表
//pollution/dataAnalysisChart
export function dataAnalysisChart(params) {
  return request({
    url: '/pollution/dataAnalysisChart',
    method: 'get',
    params,
  })
}

//=============================================================================================================================
// //重点监管企业超标统计
///KeySupervisedEnterprises/getoverdataforenterprise
export function getoverdataforenterprise(params) {
  return request({
    url: '/KeySupervisedEnterprises/getoverdataforenterprise',
    method: 'get',
    params,
  })
}

//重点监管企业超标详情
///KeySupervisedEnterprises/getEnterpriseDetail
export function getEnterpriseDetail(params) {
  return request({
    url: '/KeySupervisedEnterprises/getEnterpriseDetail',
    method: 'get',
    params,
  })
}

//重点监管企业异常统计
///KeySupervisedEnterprises/getExceptionCountByenterprise
export function getExceptionCountByenterprise(params) {
  return request({
    url: '/KeySupervisedEnterprises/getExceptionCountByenterprise',
    method: 'get',
    params,
  })
}

//重点监管企业异常统计详情
///KeySupervisedEnterprises/getExceptionEnterpriseDetail
export function getExceptionEnterpriseDetail(params) {
  return request({
    url: '/KeySupervisedEnterprises/getExceptionEnterpriseDetail',
    method: 'get',
    params,
  })
}

//=============================================================================================================================
// 日报
///pollution/reportAnalyseDay
export function reportAnalyseDay(params) {
  return request({
    url: '/pollution/reportAnalyseDay',
    method: 'get',
    params,
  })
}
// 周报
///pollution/reportAnalyseWeek
export function reportAnalyseWeek(params) {
  return request({
    url: '/pollution/reportAnalyseWeek',
    method: 'get',
    params,
  })
}
// 月报
// /pollution/reportAnalyseMonth
export function reportAnalyseMonth(params) {
  return request({
    url: '/pollution/reportAnalyseMonth',
    method: 'get',
    params,
  })
}
// 季报
///pollution/reportAnalyseQuarter
export function reportAnalyseQuarter(params) {
  return request({
    url: '/pollution/reportAnalyseQuarter',
    method: 'get',
    params,
  })
}
// 半年报
///pollution/reportAnalyseSemiannual
export function reportAnalyseSemiannual(params) {
  return request({
    url: '/pollution/reportAnalyseSemiannual',
    method: 'get',
    params,
  })
}
// 年报
// /pollution/reportAnalyseYear
export function reportAnalyseYear(params) {
  return request({
    url: '/pollution/reportAnalyseYear',
    method: 'get',
    params,
  })
}

// 日报导出
// /pollution/reportAnalyseDayExport
export function reportAnalyseDayExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseDayExport?${paramsStr}`
}
// 周报导出
// /pollution/reportAnalyseWeekExport
export function reportAnalyseWeekExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseWeekExport?${paramsStr}`
}

// 月报导出
// /pollution/reportAnalyseMonthExport
export function reportAnalyseMonthExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseMonthExport?${paramsStr}`

}
// 季报导出
///pollution/reportAnalyseQuarterExport
export function reportAnalyseQuarterExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseQuarterExport?${paramsStr}`
  // return request({
  //   url: '/pollution/reportAnalyseQuarterExport',
  //   method: 'get',
  //   params,
  //   isReturnUrl:true
  // })
}

// 半年报导出
// /pollution/reportAnalyseSemiannualExport
export function reportAnalyseSemiannualExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseSemiannualExport?${paramsStr}` 

  // return request({
  //   url: '/pollution/reportAnalyseSemiannualExport',
  //   method: 'get',
  //   params,
  //   isReturnUrl:true
  // })
}
// 年报导出
// /pollution/reportAnalyseYearExport
export function reportAnalyseYearExport(params) {
  let paramsStr = tansParams(params);
  return `${process.env.VUE_APP_BASE_API}/pollution/reportAnalyseYearExport?${paramsStr}`
  // return request({
  //   url: '/pollution/reportAnalyseYearExport',
  //   method: 'get',
  //   params,
  //   isReturnUrl:true
  // })
}


